package com.example.project.mapper;

import com.example.project.pojo.Article;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface ArticleMapper {

    //查看所有文章
    @Select("select * from article")
    List<Article> getlist();

    //上传文章
     @Insert("insert into article(title,context,description,create_user,createTime,updateTime)values (#{title},#{context},#{description},#{create_user},#{createTime},#{updateTime})")
    void add(Article article);

     @Select("select * from article where user = #{id}")
     List<Article> myList(int id);

}
